load("//integration:index.bzl", "ng_integration_test")

package(default_visibility = ["//visibility:public"])

ng_integration_test(
    name = "bazel_ngtsc_plugin_test",
    srcs = glob(["bazel_ngtsc_plugin/**"]),
    environment = {
        # Setup a HOME directory so that Bazelisk can work, both Linux/macOS and Windows variants
        # are configured to provide a fake home directory so that Bazelisk can download Bazel.
        "HOME": "<TMP>",
        "LOCALAPPDATA": "<TMP>",
    },
    tags = [
        # Bazel-in-bazel tests are resource intensive and should not be over-parallelized
        # as they will compete for the resources of other parallel tests slowing
        # everything down. Ask Bazel to allocate multiple CPUs for these tests with "cpu:n" tag.
        "cpu:3",
    ],
    # Nested bazel workspace tests need to be declared at a higher-level because the test
    # cannot be wired up within the `BUILD.bazel` file as part of the actual test workspace.
    working_dir = "bazel_ngtsc_plugin/",
)
